/*
 * Entry.h
 *
 * This header file defines some operations' 
 * prototype and their implemention written
 * in Entry.cpp.
 */
#ifndef _CONTROL_TABLE_H
#define _CONTROL_TABLE_H

namespace g_crossbit
{
   class Entry
   {
   public:
	  /* Default constructor */
	  Entry ();
	  /* Specific constructor */
	  Entry (unsigned int, unsigned int);
	  /* Get start_spc */
	  unsigned int getStartSpc ();
	  /* Get end_spc   */
	  unsigned int getEndSpc ();
   
   public:
	  /* Load entries from a file. */
	  static void loadEntries (const char *);
	  /* Display all entries pointed by start_entry. */
	  static void dumpEntries ();
	  /* Get next entry. */
	  static Entry *nextEntry ();
	  /* Free memory allocated for entries. */
	  static void freeEntries ();

   public:
	  static Entry *start_entry; /* Points to the entry of table. */
	  static Entry *cur_entry;   /* Points to the current entry.  */
	  static int   entry_num;    /* Total number of entries.      */

   private:
	  unsigned int start_spc; /* Execution point from CPU to GPU. */
	  unsigned int end_spc;   /* Execution point from GPU to CPU. */
   };
}

#endif
